<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>课表</title>
    <link rel="stylesheet" href="css/schedule.css">
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.4.0/css/all.min.css">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#165DFF',
                        secondary: '#0CB07B',
                        neutral: '#F5F7FA',
                        dark: '#1D2129',
                        light: '#FFFFFF'
                    },
                    fontFamily: {
                        inter: ['Inter', 'system-ui', 'sans-serif'],
                    },
                }
            }
        }
    </script>
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .card-shadow {
                box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
            }
            .btn-hover {
                transition: all 0.3s ease;
            }
            .btn-hover:hover {
                transform: translateY(-2px);
                box-shadow: 0 4px 12px rgba(22, 93, 255, 0.2);
            }
        }
        body {
            background-image: url('/images/background.jpg'); /* 假设图片放在public/images目录下 */
            background-size: cover;
            background-position: center;
            background-attachment: fixed;
            background-repeat: no-repeat;
            z-index: -1;  /* 确保低于内容层级 */
        }

            body::before {
                display:none;
            }
            /* 添加下拉菜单样式 */
    #user-dropdown{
        border: 1px solid #e5e7eb;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    
    #user-dropdown a:hover{
        background-color: #f9fafb;
    }
    </style>
</head>
<body class="min-h-screen flex flex-col bg-gray-50">
    <header class="bg-primary text-white shadow-sm sticky top-0 z-50">
        <div class="container mx-auto px-4 py-3 flex justify-between items-center">
            <div class="flex items-center space-x-2">
                <i class="fa-solid fa-book-open text-white text-2xl"></i>
                <h1 class="text-xl font-bold text-white">查看课表</h1>
            </div>
            <nav>
                <ul class="flex space-x-6 items-center">
                    <li><a href="#" class="text-white hover:text-neutral-200 transition-colors duration-300">返回</a></li>
                </ul>
            </nav>
            <div class="flex items-center space-x-3">
                <!-- 修改开始：添加用户信息容器 -->
                <div id="user-info-container" class="hidden text-right mr-2">
                    <div id="user-name" class="font-medium text-white"></div>
                    <div id="student-id" class="text-xs text-white/80"></div>
                </div>
                <!-- 头像区域（添加下拉菜单） -->
                <div class="relative">
                    <a href="#" id="user-avatar" class="text-white hover:text-neutral-200 transition-colors duration-300">
                        <i class="fa-solid fa-user-circle text-xl"></i>
                    </a>
                    <!-- 下拉菜单 -->
                    <div id="user-dropdown" class="absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1 z-50 hidden">
                        <a href="#" onclick="editProfile()" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
                            <i class="fas fa-user-edit mr-2"></i>编辑个人资料
                        </a>
                        <a href="#" onclick="logout()" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
                            <i class="fas fa-sign-out-alt mr-2"></i>退出登录
                        </a>
                    </div>
                </div>
            </div>
    </header>
    <main class="flex-grow container mx-auto px-4 py-6">
    <div class="bg-white rounded-xl shadow-md overflow-hidden max-w-6xl mx-auto">
    <div class="toolbar p-4 bg-gray-50 border-b flex justify-between items-center">
        <select id="weekSelector" class="px-4 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
            <!-- 周次选项将通过JS动态生成 -->
        </select>
        <div class="current-time text-gray-600"></div>
    </div>

    <div class="overflow-x-auto p-2">
    <table id="courseScheduleTable" class="course-table">
        <thead>
            <tr>
                <th colspan="8" class="header-cell">
                    <div class="semester-info">2024-2025 春季学期</div>
                </th>
            </tr>            <tr class="weekday-header">
                <th class="time-column">节次</th>
                <th>周一</th>
                <th>周二</th>
                <th>周三</th>
                <th>周四</th>
                <th>周五</th>
                <th>周六</th>
                <th>周日</th>
            </tr>
        </thead>
        <tbody>
            <!-- 课表内容将通过JS动态生成 -->
        </tbody>
    </table>
    </div>
    </div>
</main>
    <button id="backButton" onclick="goBack()">返回</button>
    <!-- 课程信息模态框 -->
    <div id="courseInfoModal" class="modal">
        <div class="modal-content">
            <div class="modal-header">
                <span class="close" onclick="closeCourseInfoModal()">&times;</span>
                <div class="course-icon">
                    <i class="fas fa-book-open"></i>
                </div>
                <h2 id="courseInfoModalTitle"></h2>
                <div class="course-tags" id="courseTags"></div>
            </div>
            
            <div class="modal-body">
                <div class="info-grid">
                    <div class="info-item">
                        <i class="fas fa-chalkboard-teacher"></i>
                        <div>
                            <label>任课教师</label>
                            <span id="courseTeacher" class="info-value"></span>
                        </div>
                    </div>
                    
                    <div class="info-item">
                        <i class="fas fa-clock"></i>
                        <div>
                            <label>时间</label>
                            <span id="courseTime" class="info-value"></span>
                        </div>
                    </div>
                    
                    <div class="info-item">
                        <i class="fas fa-map-marker-alt"></i>
                        <div>
                            <label>地点</label>
                            <span id="coursePlace" class="info-value"></span>
                        </div>
                    </div>
                    
                    <div class="info-item">
                        <i class="fas fa-calendar-week"></i>
                        <div>
                            <label>上课周次</label>
                            <span id="courseTeachWeeks" class="info-value"></span>
                        </div>
                    </div>
                    
                    <div class="info-item">
                        <i class="fas fa-barcode"></i>
                        <div>
                            <label>课程编号</label>
                            <span id="courseCode" class="info-value"></span>
                        </div>
                    </div>
                    
                    <div class="info-item">
                        <i class="fas fa-star"></i>
                        <div>
                            <label>课程学分</label>
                            <span id="courseCredits" class="info-value"></span>
                        </div>
                    </div>
                    
                    <div class="info-item">
                        <i class="fas fa-hourglass-half"></i>
                        <div>
                            <label>课程学时</label>
                            <span id="courseStudyPeriod" class="info-value"></span>
                        </div>
                    </div>
                    
                    <div class="info-item">
                        <i class="fas fa-clipboard-check"></i>
                        <div>
                            <label>考核方式</label>
                            <span id="courseAssessmentMethod" class="info-value"></span>
                        </div>
                    </div>
                    
                    <div class="info-item">
                        <i class="fas fa-list-ol"></i>
                        <div>
                            <label>上课节次</label>
                            <span id="courseClassPeriod" class="info-value"></span>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="modal-footer">
                <button id="confirmButton" onclick="closeCourseInfoModal()">
                    <i class="fas fa-check"></i> 确定
                </button>
            </div>
        </div>
    </div>
    <footer class="bg-dark text-white py-8 mt-12">
        <div class="container mx-auto px-4">
            <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
                <div>
                    <h3 class="text-lg font-semibold mb-4">查看课表</h3>
                    <p class="text-gray-400">学生可以在这里查看自己的课表。</p>
                </div>
                <div>
                    <h3 class="text-lg font-semibold mb-4">联系我们</h3>
                    <ul class="space-y-2 text-gray-400">
                        <li><i class="fa-solid fa-envelope mr-2"></i> softclass-platform@qq.com</li>
                        <li><i class="fa-solid fa-phone mr-2"></i> 114-514-1919-810</li>
                    </ul>
                </div>
                <div>
                    <h3 class="text-lg font-semibold mb-4">关注我们</h3>
                    <div class="flex space-x-4">
                        <a href="#" class="text-gray-400 hover:text-white transition-colors duration-300">
                            <i class="fa-brands fa-weixin text-xl"></i>
                        </a>
                        <a href="#" class="text-gray-400 hover:text-white transition-colors duration-300">
                            <i class="fa-brands fa-weibo text-xl"></i>
                        </a>
                        <a href="#" class="text-gray-400 hover:text-white transition-colors duration-300">
                            <i class="fa-brands fa-github text-xl"></i>
                        </a>
                    </div>
                </div>
            </div>
            <div class="border-t border-gray-700 mt-8 pt-8 text-center text-gray-400">
                <p>© 2025 软课程管理平台 版权所有</p>
            </div>
        </div>
    </footer>
    <script type="module" src="js/schedule.js"></script>
</body>
</html>